package appconfig

import (
	"fmt"
	"github.com/spf13/viper"
)

type AppConfig struct {
	MysqlInit
	InitRedis
}
type MysqlInit struct {
	Hort string
	User string
	Pass string
	Part int
	Data string
}
type InitRedis struct {
	Addr     string
	Password string
	DB       int
}

var AppCon AppConfig

func InitMysql() {
	viper.SetConfigFile("./appconfig/test.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&AppCon)
	fmt.Println("动态配置连接成功", AppCon)
}
